package com.enbatis.mybatisplugs.commons.utils;

public class CodeMsg {

    private int retCode;
    private String message;
    // 按照模块定义CodeMsg

    public static CodeMsg SUCCESS = new CodeMsg(0,"success");
    // 通用异常
    public static CodeMsg FAILED = new CodeMsg(-1,"failed");
    public static CodeMsg SERVER_EXCEPTION = new CodeMsg(200100,"服务端异常");
    public static CodeMsg PARAMETER_ISNULL = new CodeMsg(200101,"输入参数为空");
    public static CodeMsg NULLPOINT = new CodeMsg(200102,"空指针异常");
    public static CodeMsg PARAM_NOT_OK = new CodeMsg(200103,"请求参数不匹配");
    public static CodeMsg SQL_EXCEPTION = new CodeMsg(200104,"数据库访问异常");
    // 业务异常
    public static CodeMsg USER_NOT_EXSIST = new CodeMsg(500102,"用户不存在");
    public static CodeMsg ONLINE_USER_OVER = new CodeMsg(500103,"在线用户数超出允许登录的最大用户限制。");
    public static CodeMsg SESSION_NOT_EXSIST =  new CodeMsg(500104,"不存在离线session数据");
    public static CodeMsg NOT_FIND_DATA = new CodeMsg(500105,"查找不到对应数据");
    public static CodeMsg LOGIN_USER_PSD_ERROR = new CodeMsg(100001,"用户名或密码错误");

    private CodeMsg(int retCode, String message) {
        this.retCode = retCode;
        this.message = message;
    }
    public int getRetCode() {
        return retCode;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }


}
